﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="Course" Object="Course" InnerID="Request.QueryString['CourseID']" />
<ali:Get ID="Lesson" Object="Lesson" InnerID="Request.QueryString['ID']" />
<section data-page="lesson_edit" data-title="编辑课件" data-id="<%=Request.QueryString["ID"]%>" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="../list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">课程列表</a> → <b class="<%=ContentLang%>Font"><%=Course[Name]%></b></dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Mark="System" Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="../edit.aspx?Lang=<%=ContentLang%>&amp;ID=<%=Request.QueryString["CourseID"]%>" target="ali-navtab">编辑</a></li>
							<li><a href="list.aspx?Lang=<%=ContentLang%>&amp;CourseID=<%=Request.QueryString["CourseID"]%>" target="ali-navtab">课件列表</a></li>
							<li><a href="add.aspx?Lang=<%=ContentLang%>&amp;CourseID=<%=Request.QueryString["CourseID"]%>" target="ali-navtab">添加课件</a></li>
							<li class="ali-active"><a>编辑课件</a></li>
						</ul>
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" value="<%=Lesson[Name]%>" size="60" maxlength="150" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<%If !Convert.ToBoolean(Lesson[IsChapter])%>
								<%If Convert.ToString(Course[MediaType]) == "VIDEO" || Convert.ToString(Course[MediaType]) == "AUDIO"%>
									<tr>
										<th>媒体类型：</th>
										<td>
											<%If Convert.ToString(Lesson[MediaType]) == "VIDEO"%>
												<label><input type="radio" name="MediaType" value="VIDEO" checked>视频</label>
												<label><input type="radio" name="MediaType" value="AUDIO">音频</label>
											<%Else%>
												<label><input type="radio" name="MediaType" value="VIDEO">视频</label>
												<label><input type="radio" name="MediaType" value="AUDIO" checked>音频</label>
											<%EndIf%>
										</td>
									</tr>
									<tr>
										<th>播放地址：</th>
										<td>
											<input type="text" name="Url" value="<%=Lesson[Url]%>" size="60" maxlength="255" class="ali-input CHSFont">
											<p>
												<%If Convert.ToString(Lesson[MediaType]) == "VIDEO"%>
													<video data-player="VIDEO" src="<%=Lesson[Url]%>" controls="controls" style="width:230px;height:200px"></video>
													<audio data-player="AUDIO" src="<%=Lesson[Url]%>" controlsList="nodownload" controls="true" style="width:400px;display:none"></audio>
												<%Else%>
													<video data-player="VIDEO" src="<%=Lesson[Url]%>" controls="controls" style="width:230px;height:200px;display:none"></video>
													<audio data-player="AUDIO" src="<%=Lesson[Url]%>" controlsList="nodownload" controls="true" style="width:400px"></audio>
												<%EndIf%>
											</p>
										</td>
									</tr>
									<tr>
										<th>播放长度：</th>
										<td><input type="number" name="Duration" value="<%=Lesson[Duration]%>" value="0" min="0" required class="ali-input CHSFont" style="width:60px">秒，<button type="button" data-operation="GetDuration" class="ali-button">获取长度</button></td>
									</tr>
									<tr>
										<th>试用长度：</th>
										<td><input type="number" name="FreeDuration" value="<%=Lesson[FreeDuration]%>" value="0" min="0" required class="ali-input CHSFont" style="width:60px">秒</td>
									</tr>
								<%Else%>
									<tr>
										<th>是否免费：</th>
										<td>
											<%If Convert.ToInt32(Lesson[FreeDuration]) > 0%>
												<label><input type="radio" name="FreeDuration" value="1" checked>是</label>
												<label><input type="radio" name="FreeDuration" value="0">否</label>
											<%Else%>
												<label><input type="radio" name="FreeDuration" value="1">是</label>
												<label><input type="radio" name="FreeDuration" value="0" checked>否</label>
											<%EndIf%>
										</td>
									</tr>
								<%EndIf%>
								<tr>
									<th>描述：</th>
									<td>
										<textarea name="Description" data-instance="<%=InstanceID%>" class="editor"><%=HttpUtility.HtmlEncode(Lesson[Description].ToString())%></textarea>
									</td>
								</tr>
							<%EndIf%>
							<tr>
								<th>序号：</th>
								<td><input type="number" name="Sort" value="<%=Lesson[Sort]%>" min="1" required class="ali-input CHSFont" style="width:60px"></td>
							</tr>
							<tr>
								<th>是否上架：</th>
								<td>
									<%If Convert.ToBoolean(Lesson[IsReleased])%>
										<label><input type="radio" name="IsReleased" value="true" checked>是</label>
										<label><input type="radio" name="IsReleased" value="false">否</label>
									<%Else%>
										<label><input type="radio" name="IsReleased" value="true">是</label>
										<label><input type="radio" name="IsReleased" value="false" checked>否</label>
									<%EndIf%>
								</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">保 存</button></div>
	</form>
</section>